﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace AgilePokerCards
{
    public partial class FormCard : Form
    {
        public CardType Card { get; set; }

        public FormCard()
        {
            InitializeComponent();
        }

        private void Form_Load(object sender, EventArgs e)
        {
            button.BackColor = BackColor;
            button.ForeColor = ForeColor;
            button.Text = Helper.GetCardDetails(Card);

            switch (Card)
            {
                case CardType.About:
                case CardType.Back:
                case CardType.More:
                    // don't use this form for these options
                    Close();
                    break;

                case CardType.Zero:
                case CardType.Half:
                case CardType.One:
                case CardType.Two:
                case CardType.Three:
                case CardType.Five:
                case CardType.Eight:
                case CardType.Thirteen:
                case CardType.Twenty:
                case CardType.Forty:
                case CardType.Infinity:
                case CardType.Question:
                    button.Font = new Font("Tahoma", 110F, FontStyle.Bold);
                    break;

                case CardType.Hunderd:
                    button.Font = new Font("Tahoma", 90F, FontStyle.Bold);
                    break;

                default:
                    // Load Image form
                    FormImage formImage = new FormImage { Card = Card };
                    formImage.Show();

                    // Close current form
                    Close();
                    break;
            }
        }

        private void button_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}